package com.lin.mapper;

import com.lin.entity.CollectionEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CollectionMapper {


    /**
     * 根据用户id查询收藏夹
     * @param userId
     * @return
     */
    @Select("select * from collection where user_id = #{userId}")
    CollectionEntity getCollection(Integer userId);

    /**
     * 新建收藏夹
     * @param collection
     */
    void saveClt(CollectionEntity collection);

    /**
     * 更新收藏夹
     * @param collection
     */
    void updateClt(CollectionEntity collection);

    @Delete("delete from collection where id = #{id}")
    void deleteClt(Integer id);
}
